package com.lee.thread;

import java.util.Random;

public class ThreadTest {
	public static void main(String[] args) {
		Thread thread = Thread.currentThread();
		thread.setName("MyThread");
		for (int i = 0; i < 10; i++) {
			try {
				int sleepTime = new Random().nextInt(5000);
				Thread.sleep(sleepTime);
				System.out.println("第"+i+"次："+sleepTime);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
